<?php
/**
 * Created by PhpStorm.
 * User: xh
 * Date: 2021/8/6
 * Time: 9:42
 */

class userDb
{
    /**
     * 注册函数
     * @param $name
     * @param $pass
     * @param $time
     * @return bool|PDO|string
     */
    public function regirtor($name, $pass, $time)
    {

        $sql = "insert into user (name,password,addtime) values ('$name','$pass','$time')";
        $Con = new CON();
        return $Con->add($sql);


    }

    /**
     * 登录
     * @param $name
     * @param $pass
     */
    public function login($name, $pass){

        $sql="select * from user where name='$name' and  password='$pass'";
        $Con=new CON();
        return $Con->query($sql);
    }


}